package cn.chart.controller;

import cn.chart.domain.Users;
import cn.chart.service.UserService;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;

import javax.annotation.Resource;

@Controller
public class UserController {

    @Resource
    private UserService userService;

    @RequestMapping(value = "SubLogin",produces = "application/json;charset=UTF-8",method = RequestMethod.POST)
    @ResponseBody
    public Object SubLogin(Users user){
        System.out.println(user.getUsername()+","+user.getPassword());
        boolean flag =userService.checkUser(user);
        if(flag)
            return "登陆成功";
        return "登陆失败";
    }
}
